import java.util.Arrays;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        while (T-- > 0) {
            long n = in.nextLong();
            long a = in.nextLong();
            long b = in.nextLong();

            long ans = Long.MAX_VALUE;

            // 直接只用2人船 和 只用3人船 两种简单方案
            ans = Math.min(ans, ((n + 1) / 2) * a); // ceil(n/2)*a
            ans = Math.min(ans, ((n + 2) / 3) * b); // ceil(n/3)*b

            // 构造候选 y（3人船数量）周围的小范围
            long yFloor = n / 3;
            for (long dy = -2; dy <= 2; dy++) {
                long y = yFloor + dy;
                if (y < 0) continue;
                long left = n - 3 * y;
                long x = 0;
                if (left > 0) x = (left + 1) / 2; // ceil(left/2)
                long cost = x * a + y * b;
                ans = Math.min(ans, cost);
            }

            // 同理也围绕 xFloor 枚举小范围（2人船数量）
            long xFloor = n / 2;
            for (long dx = -2; dx <= 2; dx++) {
                long x = xFloor + dx;
                if (x < 0) continue;
                long left = n - 2 * x;
                long y = 0;
                if (left > 0) y = (left + 2) / 3; // ceil(left/3)
                long cost = x * a + y * b;
                ans = Math.min(ans, cost);
            }

            System.out.println(ans);
        }
        in.close();
    }
}
